<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="css/skin.css" />
    <script type="text/javascript">
        function logout() {
            if(window.confirm('您确定要退出吗？')) {
                top.location = 'login';
            }
        }
        function zhujie() {
            top.location = 'index';
        }
    </script>
</head>
<body>
<div width="1000px" id="top" th:include="/top :: top"></div>
<div id="lief" th:include="/lief :: lief"></div>
<div id="chaxun">
    <table width="800px">
        <tr>
            <td colspan="2">
                <form action="" method="">
                    <table width="100%"  class="cont tr_color">
                        <tr>
                            <th>选中</th>
                            <th>订单编号/下单时间</th>
                            <th>订单产品列表</th>
                            <th>订单金额</th>
                            <th>收货人信息</th>
                            <th>订单状态</th>
                            <th>操作</th>
                        </tr>
                        <tr align="center" class="d">
                            <td><input type="checkbox" value="" /></td>
                            <td>1</td>
                            <td>小米手机</td>
                            <td>1499</td>
                            <td>手机</td>
                            <td>3G手机</td>
                            <td>删除</td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
    $(function (){
        var typeId = GetQueryString("typeId");
        var pid = null;
        $.ajax({
            "url":"/T309tgspringboot/menu/selP",
            "type":"get",
            "async" : false,//设为同步
            "data":{"typeId":typeId},
            "dataType":"json",
            "success":function(a){
                var r = a.result["selPM"];
                for(var i = 0 ; i < r.length ; i++){
                    var html = "";
                    html+='<li>' +
                        '<dl id="biaoti">' +
                        '<dt id="a">'+r[i].title+'</dt>' +
                        '</dl>' +
                        '</li>';
                    pid = r[i].typeId;
                    $('#caidan').append(html);
                }
            },
            "error":function(){
                alert("服务器错误");
            }
        })
        $.ajax({
            "url":"/T309tgspringboot/menu/selSon",
            "type":"post",
            "async" : false,//设为同步
            "data":{"pid":pid},
            "dataType":"json",
            "success":function(a){
                var r = a.result["selSon"];
                for(var i = 0 ; i < r.length ; i++){
                        var html = "";
                        html+='<dd id="b"><a href="">'+r[i].title+'</a></dd>';
                        $('#biaoti').append(html);
                }
            },
            "error":function(){
                alert("服务器错误");
            }
        })
        $("dd").slideUp("slow");;
        var a = 0;
        $("ul li dl").click(function(){
            if(a==0){
                $(this).children("dd").slideDown("slow");
                a++;
            }else if(a==1){
                $(this).children("dd").slideUp("slow");
                a=0;
            }
        })
    })
</script>
</html>